package com.jlf.core.output;

import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

/**
 * 列表输出结果封装
 *
 * @author ym
 * @version 1.0
 * 2020-11-10
 */
@Getter
@Setter
public class ListResultWrapper<T> {
    /**
     * 记录总数
     */
    private Integer total;
    /**
     * 本次的输出结果
     */
    private Collection<T> record;

    public ListResultWrapper(){}

    public ListResultWrapper(Collection<T> record){
        this.total = record.size();
        this.record = record;
    }
    public ListResultWrapper(T[] record){
        this.total = record.length;
        this.record = Arrays.asList(record);
    }
}
